package com.example.mytextcamera2.awbstrategy;

import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCaptureSession;
import android.hardware.camera2.CaptureRequest;
import android.os.Build;
import android.os.Handler;

import androidx.annotation.RequiresApi;

@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public class AwbIncandescent implements AwbStrategy{
    @Override
    public void setCaptureRequest(CaptureRequest.Builder requestBuilder, CameraCaptureSession cameraCaptureSession, Handler handler) {
        //白炽灯
        requestBuilder.set(CaptureRequest.CONTROL_AWB_MODE,CaptureRequest.CONTROL_AWB_MODE_INCANDESCENT);
        try {
            cameraCaptureSession.setRepeatingRequest(requestBuilder.build(),null,handler);
        }catch (CameraAccessException e){
            e.printStackTrace();
        }
    }
}
